package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.UUserRefereeEarningMapper;
import com.ruoyi.system.domain.api.UUserRefereeEarning;
import com.ruoyi.system.service.IUUserRefereeEarningService;

/**
 * 用户推荐收益Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-22
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class UUserRefereeEarningServiceImpl implements IUUserRefereeEarningService 
{
    @Autowired
    private UUserRefereeEarningMapper uUserRefereeEarningMapper;

    /**
     * 查询用户推荐收益
     * 
     * @param id 用户推荐收益主键
     * @return 用户推荐收益
     */
    @Override
    public UUserRefereeEarning selectUUserRefereeEarningById(Long id)
    {
        return uUserRefereeEarningMapper.selectUUserRefereeEarningById(id);
    }

    /**
     * 查询用户推荐收益列表
     * 
     * @param uUserRefereeEarning 用户推荐收益
     * @return 用户推荐收益
     */
    @Override
    public List<UUserRefereeEarning> selectUUserRefereeEarningList(UUserRefereeEarning uUserRefereeEarning)
    {
        return uUserRefereeEarningMapper.selectUUserRefereeEarningList(uUserRefereeEarning);
    }

    /**
     * 新增用户推荐收益
     * 
     * @param uUserRefereeEarning 用户推荐收益
     * @return 结果
     */
    @Override
    public int insertUUserRefereeEarning(UUserRefereeEarning uUserRefereeEarning)
    {
        uUserRefereeEarning.setCreateTime(DateUtils.getNowDate());
        return uUserRefereeEarningMapper.insertUUserRefereeEarning(uUserRefereeEarning);
    }

    /**
     * 修改用户推荐收益
     * 
     * @param uUserRefereeEarning 用户推荐收益
     * @return 结果
     */
    @Override
    public int updateUUserRefereeEarning(UUserRefereeEarning uUserRefereeEarning)
    {
        return uUserRefereeEarningMapper.updateUUserRefereeEarning(uUserRefereeEarning);
    }

    /**
     * 批量删除用户推荐收益
     * 
     * @param ids 需要删除的用户推荐收益主键
     * @return 结果
     */
    @Override
    public int deleteUUserRefereeEarningByIds(Long[] ids)
    {
        return uUserRefereeEarningMapper.deleteUUserRefereeEarningByIds(ids);
    }

    /**
     * 删除用户推荐收益信息
     * 
     * @param id 用户推荐收益主键
     * @return 结果
     */
    @Override
    public int deleteUUserRefereeEarningById(Long id)
    {
        return uUserRefereeEarningMapper.deleteUUserRefereeEarningById(id);
    }
}
